<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');

?>

<?php if ($this->params->get('show_page_heading', 1)) : ?>
	<h3>
		<?php echo $this->escape($this->params->get('page_heading')); ?>
	</h3>
	<?php endif; ?>

	<?php if ($this->params->get('show_category_title', 1) or $this->params->get('page_subheading')) : ?>
	<h2>
		<?php echo $this->escape($this->params->get('page_subheading')); ?>
		<?php if ($this->params->get('show_category_title')) : ?>
			<span class="subheading-category"><?php echo $this->category->title;?></span>
		<?php endif; ?>
	</h2>
	<?php endif; ?>

<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
<br />

<div class="gallery ofh">
<table>
				<tr>



<?php $leadingcount=0 ; ?>
<?php if (!empty($this->lead_items)) : ?>

	<?php foreach ($this->lead_items as &$item) : ?>
		<td class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>">
			<?php
				$this->item = &$item;
				echo $this->loadTemplate('item');
			?>
		</td>
		<?php
			if($leadingcount%5 == 4) echo '</tr><tr>';
			$leadingcount++;
		?>
	<?php endforeach; ?>

<?php endif; ?>
					
					
					
				</tr>
			</table>
			
			<?php if (($this->params->def('show_pagination', 1) == 1  || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
		<div class="pagination">						
				<?php echo $this->pagination->getPagesLinks(); ?>
		</div>
<?php  endif; ?>
</div>

